﻿@using System.Web.Configuration
@{
    ViewBag.Title = "System Deployment";
}
<div class="row">
    @Html.Action("PV_SCCMCollections", "TreeView", new { RootCollectionID = @WebConfigurationManager.AppSettings["DeploymentOSRoot"] })
    @Html.Action("TargetRooms", "Deployment", new { RootCollectionID = @WebConfigurationManager.AppSettings["DeploymentRoomRoot"] })
</div>
<script type="text/javascript">
    function onNodeDrop(e) {
        var dropContainer = $(e.dropTarget).closest('.drop-container');
        var treeview = $('#CollectionTreeView').data('tTreeView');
        var nodeText = treeview.getItemText(e.item);
        if (dropContainer.length > 0) {
            dropContainer[0].value = nodeText;
            var ID = dropContainer[0].name.substr(7, 1)
            var OSIDName = 'OSID[' + ID + ']';
            var osid = document.getElementsByName(OSIDName)
            if (osid.length > 0) {
                osid[0].value = treeview.getItemValue(e.item);
            }
            e.preventDefault();
        }
    }
</script>